import JsEncrypt from 'jsencrypt/bin/jsencrypt'



export function rsaEncrypt (obj, publicKey) {
  let encryptor = new JsEncrypt();
  // let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCURjYNtDjduYvMOuiXMpskeLCcQhpw6Pp4w0s9cpccFu9NT+OxC4sYAYye1ezOz+anjyWQ0UXkVgXQs2c8P80qm7z0KkpFfdp3Pn6JCwXQ0i7fvvFMkK4DEaX/ZkQj7k1cScSjsYLRx4YRUoC5kB5bCFXJwj0zv4AWkLUrtFEwXQIDAQAB'

  encryptor.setPublicKey(publicKey)
  return encryptor.encrypt(obj)
}

// export function rsaEncrypt (obj) {
//   let encryptor = new JsEncrypt();
//   let publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCURjYNtDjduYvMOuiXMpskeLCcQhpw6Pp4w0s9cpccFu9NT+OxC4sYAYye1ezOz+anjyWQ0UXkVgXQs2c8P80qm7z0KkpFfdp3Pn6JCwXQ0i7fvvFMkK4DEaX/ZkQj7k1cScSjsYLRx4YRUoC5kB5bCFXJwj0zv4AWkLUrtFEwXQIDAQAB'
//
//   encryptor.setPublicKey(publicKey)
//   return encryptor.encrypt(obj)
// }


